function toFile(buff, filename, type) {
    return new File(buff, filename, {type})
}

onmessage = e => {
    postMessage(toFile(e.data.chunks, e.data.filename, e.data.type))
}